#!/bin/bash

yum -y install wget

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime;

systemctl stop firewalld.service;

systemctl disable firewalld.service;

firewall-cmd --state;

cd /data/;

wget http://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.12.6-1.el7.centos.x86_64.rpm;

wget https://gitee.com/aisao/full_container_station_scheme/raw/master/docker-engine-selinux-1.12.6-1.el7.centos.noarch.rpm;

mkdir -p docker;

ln -s /data/docker /var/lib/docker;

yum -y install policycoreutils-python selinux-policy-base selinux-policy-targeted libseccomp libtool-ltdl device-mapper-libs;

rpm -ivh docker-engine-selinux-1.12.6-1.el7.centos.noarch.rpm

rpm -ivh docker-engine-1.12.6-1.el7.centos.x86_64.rpm

service docker start

tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://registry.docker-cn.com"],"insecure-registries":["192.168.1.111:5000"]}
EOF

service docker restart